/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.business.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.ToString;
import me.zhengjie.base.BaseBusiness;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.Objects;

/**
* @website https://el-admin.vip
* @description /
* @author xiahongbo
* @date 2022-07-18
**/
@Entity
@Data
@Table(name="BIS_WHFA_FFX")
public class WhfaFfx extends BaseBusiness implements Serializable {

    @Id
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @GeneratedValue(generator = "hibernate-uuid")
    @Column(name = "BIS_WHFA_FFX_ID")
    @ApiModelProperty(value = "主键ID")
    private String bisWhfaFfxId;

    @JoinColumn(name = "BIS_WHFA_FAID",insertable = false,updatable = false)
    @ManyToOne(fetch=FetchType.LAZY)
    @ApiModelProperty(value = "方案ID", hidden = true)
    @JSONField(serialize = false)
    @ToString.Exclude
    private Whfa whfa;

    @Column(name = "BIS_WHFA_FAID")
    @ApiModelProperty(value = "方案ID")
    private String bisWhfaFaid;

    @Column(name = "BIS_WHFA_ZHID")
    @ApiModelProperty(value = "照护ID")
    private Long bisWhfaZhid;

    @Column(name = "BIS_WHFA_DZID")
    @ApiModelProperty(value = "对照ID")
    private String bisWhfaDzid;

    @Column(name = "BIS_WHFA_FFX_FWBM")
    @ApiModelProperty(value = "服务项目编码")
    private String bisWhfaFfxFwbm;

    @Column(name = "BIS_WHFA_FFX_FWMC")
    @ApiModelProperty(value = "服务项目名称")
    private String bisWhfaFfxFwmc;

    @Column(name = "BIS_WHFA_FFX_FWSC")
    @ApiModelProperty(value = "服务时长")
    private String bisWhfaFfxFwsc;

    @Column(name = "BIS_WHFA_FFX_FWLX")
    @ApiModelProperty(value = "服务类型")
    private String bisWhfaFfxFwlx;

    @Column(name = "BIS_WHFA_FFX_JSLX")
    @ApiModelProperty(value = "结算类型")
    private String bisWhfaFfxJslx;

    @Column(name = "BIS_WHFA_FFX_SL")
    @ApiModelProperty(value = "数量")
    private String bisWhfaFfxSl;

    @Column(name = "BIS_WHFA_FFX_ZJM")
    @ApiModelProperty(value = "助记码")
    private String bisWhfaFfxZjm;

    @Column(name = "BIS_WHFA_FFX_DJ")
    @ApiModelProperty(value = "单价")
    private BigDecimal bisWhfaFfxDj;

    @Column(name = "BIS_WHFA_FFX_YBMC")
    @ApiModelProperty(value = "医保名称")
    private String bisWhfaFfxYbmc;

    @Column(name = "BIS_WHFA_FFX_YBDJ")
    @ApiModelProperty(value = "医保单价")
    private BigDecimal bisWhfaFfxYbdj;

    @Column(name = "BIS_WHFA_FFX_YBZJM")
    @ApiModelProperty(value = "医保助记码")
    private String bisWhfaFfxYbzjm;




    public void copy(WhfaFfx source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    @Override
    public int hashCode() {
        return Objects.hash(bisWhfaFfxId, bisWhfaZhid);
    }
}